{% extends "base.html" %}
{% load staticfiles %}
{% block title %}宝宝提醒日期列表{% endblock %}
{% block addoncss %}
 <link href="{% static 'css/itemlist.css' %}" rel="stylesheet">
{% endblock %}
<!DOCTYPE html>
          {% block content %}
          <div class="inner cover">
          <h1>{{dinfo.g}}{{dinfo.n}}</h1>
          <div class="row" style="margin: 25px auto;">
		        <div class="col-md-8 noborder"><input type="text" class="form-control" id="selectdt" onchange="selectDay()" data-date-format="YYYY-MM-DD" name="selectdt" style="background-color: #4DDDDD;border: 0; color: black; font-weight: bold;" value="{{dinfo.gi}}" /></div>
				{% if isToday != True %}
				<div class="btn btn-lg btn-primary" onclick="returnToday()">返回今天</div>
				{% endif %}
			</div>
          	<div class="row">
		        <div class="col-md-2">一</div>
		        <div class="col-md-2">二</div>
		        <div class="col-md-2">三</div>
		        <div class="col-md-2">四</div>
		        <div class="col-md-2">五</div>
		        <div class="col-md-2 weekend">六</div>
		        <div class="col-md-2 weekend">日</div>
	      	</div>
	      	{% if dayli %}
	      		{% for d in dayli %}
	      			{% if d.w == 1 %}
	      			<div class="row date">
	      			{% endif %}
	      			<div class="col-md-2 {% if d.gm != now.month %} outmonth {% endif %} {% if d.w = 0 or d.w = 6 %} weekend {% endif %} {% if d.gy = now.year and d.gm = now.month and d.gd = now.day  %}
	      			today{% endif %} {% if  d.items %}infoimg {% endif %} "
	      			data-toggle="popover" data-placement="left" data-trigger="hover"
	      			data-content="{{d.items}}"   {% if  d.items %}title=" 备忘项目 " {% endif %} 
	      			
	      			>
	      			{{d.gd}}<br/>{{d.nd}} 
	      			
	      			</div>
	      			{% if d.w == 0 %}
	      			</div>
	      			{% endif %}
	      		{% endfor %}
	      	{% else %}
	      	<div class="row date">日期读取出错</div>
	      	{% endif %}
	      	
          </div>
          {% endblock %}
{% block addonjs %}
$(function() {
	$('#selectdt').datetimepicker(
			{pickTime: false}
	);
});

function returnToday(){
	location.href="/";
}
function selectDay(){
	var dt = $('#selectdt').val();
	location.href="/?dt="+dt;
}
{% endblock %}

